<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>登录 - 外卖APP</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.0/font/bootstrap-icons.css">
    <style>
        body {
            margin: 0;
            padding: 0;
            background: #f5f5f5;
            font-family: 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
            color: #333;
        }
        .phone-container {
            width: 390px;
            height: 844px;
            margin: 20px auto;
            background: white;
            position: relative;
            overflow: hidden;
            box-shadow: 0 0 20px rgba(0,0,0,0.1);
            border-radius: 40px;
        }
        .content {
            height: 100%;
            overflow-y: auto;
            background-color: white;
            display: flex;
            flex-direction: column;
        }
        .header {
            padding: 16px;
            display: flex;
            align-items: center;
            justify-content: flex-end;
        }
        .close-btn {
            color: #666;
            text-decoration: none;
            font-size: 24px;
            display: flex;
            align-items: center;
        }
        .login-container {
            padding: 20px 30px;
            flex: 1;
        }
        .logo-area {
            text-align: center;
            margin-bottom: 40px;
        }
        .app-logo {
            width: 80px;
            height: 80px;
            border-radius: 20px;
            background: #0095ff;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            margin-bottom: 15px;
            box-shadow: 0 4px 15px rgba(0, 149, 255, 0.2);
        }
        .app-logo i {
            font-size: 40px;
            color: white;
        }
        .app-name {
            font-size: 24px;
            font-weight: 600;
            color: #333;
        }
        .app-slogan {
            font-size: 14px;
            color: #999;
            margin-top: 5px;
        }
        .login-tabs {
            display: flex;
            margin-bottom: 30px;
            border-bottom: 1px solid #f0f0f0;
        }
        .login-tab {
            flex: 1;
            text-align: center;
            padding: 12px 0;
            font-size: 16px;
            color: #666;
            cursor: pointer;
            position: relative;
        }
        .login-tab.active {
            color: #0095ff;
            font-weight: 500;
        }
        .login-tab.active::after {
            content: '';
            position: absolute;
            bottom: -1px;
            left: 25%;
            width: 50%;
            height: 2px;
            background: #0095ff;
            border-radius: 2px;
        }
        .login-form {
            margin-top: 20px;
        }
        .form-group {
            margin-bottom: 20px;
        }
        .form-label {
            font-size: 14px;
            color: #666;
            margin-bottom: 8px;
        }
        .form-input {
            width: 100%;
            padding: 12px 15px;
            border: 1px solid #e0e0e0;
            border-radius: 8px;
            font-size: 15px;
            transition: all 0.3s ease;
        }
        .form-input:focus {
            border-color: #0095ff;
            box-shadow: 0 0 0 2px rgba(0, 149, 255, 0.1);
            outline: none;
        }
        .form-input::placeholder {
            color: #ccc;
        }
        .code-input-group {
            display: flex;
            gap: 10px;
        }
        .code-input {
            flex: 1;
        }
        .code-btn {
            width: 120px;
            background: #f5f5f5;
            border: 1px solid #e0e0e0;
            border-radius: 8px;
            color: #666;
            font-size: 14px;
            cursor: pointer;
        }
        .code-btn:disabled {
            color: #999;
            cursor: not-allowed;
        }
        .login-btn {
            width: 100%;
            padding: 13px;
            background: #0095ff;
            color: white;
            border: none;
            border-radius: 8px;
            font-size: 16px;
            font-weight: 500;
            margin-top: 10px;
            cursor: pointer;
            transition: all 0.3s ease;
        }
        .login-btn:hover {
            background: #0085e5;
        }
        .login-options {
            margin-top: 20px;
            display: flex;
            justify-content: space-between;
            font-size: 14px;
            color: #666;
        }
        .login-options a {
            color: #0095ff;
            text-decoration: none;
        }
        .other-login {
            margin-top: 40px;
            text-align: center;
        }
        .other-login-title {
            position: relative;
            font-size: 14px;
            color: #999;
            margin-bottom: 20px;
        }
        .other-login-title::before,
        .other-login-title::after {
            content: '';
            position: absolute;
            top: 50%;
            width: 80px;
            height: 1px;
            background: #f0f0f0;
        }
        .other-login-title::before {
            left: 40px;
        }
        .other-login-title::after {
            right: 40px;
        }
        .other-login-buttons {
            display: flex;
            justify-content: center;
            gap: 30px;
        }
        .other-login-btn {
            width: 50px;
            height: 50px;
            border-radius: 50%;
            background: #f5f5f5;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #666;
            font-size: 24px;
            cursor: pointer;
            transition: all 0.3s ease;
        }
        .other-login-btn:hover {
            background: #e8e8e8;
        }
        .agreement {
            margin-top: 30px;
            font-size: 12px;
            color: #999;
            text-align: center;
            line-height: 1.5;
        }
        .agreement a {
            color: #0095ff;
            text-decoration: none;
        }
        .tab-content {
            display: none;
        }
        .tab-content.active {
            display: block;
        }
    </style>
</head>
<body>
    <div class="phone-container">
        <div class="content">
            <div class="header">
                <a href="index.html" class="close-btn">
                    <i class="bi bi-x-lg"></i>
                </a>
            </div>

            <div class="login-container">
                <div class="logo-area">
                    <div class="app-logo">
                        <i class="bi bi-bag"></i>
                    </div>
                    <div class="app-name">外卖APP</div>
                    <div class="app-slogan">美食随时送到家</div>
                </div>

                <div class="login-tabs">
                    <div class="login-tab active" data-tab="phone">手机号登录</div>
                    <div class="login-tab" data-tab="password">密码登录</div>
                </div>

                <div class="tab-content active" id="phone-tab">
                    <div class="login-form">
                        <div class="form-group">
                            <div class="form-label">手机号</div>
                            <input type="tel" class="form-input" placeholder="请输入手机号" maxlength="11">
                        </div>
                        <div class="form-group">
                            <div class="form-label">验证码</div>
                            <div class="code-input-group">
                                <input type="text" class="form-input code-input" placeholder="请输入验证码" maxlength="6">
                                <button class="code-btn">获取验证码</button>
                            </div>
                        </div>
                        <button class="login-btn">登录</button>
                    </div>
                </div>

                <div class="tab-content" id="password-tab">
                    <div class="login-form">
                        <div class="form-group">
                            <div class="form-label">手机号</div>
                            <input type="tel" class="form-input" placeholder="请输入手机号" maxlength="11">
                        </div>
                        <div class="form-group">
                            <div class="form-label">密码</div>
                            <input type="password" class="form-input" placeholder="请输入密码">
                        </div>
                        <button class="login-btn">登录</button>
                    </div>
                </div>

                <div class="login-options">
                    <a href="register.html">新用户注册</a>
                    <a href="#">忘记密码</a>
                </div>

                <div class="other-login">
                    <div class="other-login-title">其他登录方式</div>
                    <div class="other-login-buttons">
                        <div class="other-login-btn">
                            <i class="bi bi-wechat" style="color: #07C160;"></i>
                        </div>
                        <div class="other-login-btn">
                            <i class="bi bi-apple" style="color: #000;"></i>
                        </div>
                        <div class="other-login-btn">
                            <i class="bi bi-person-circle" style="color: #0095ff;"></i>
                        </div>
                    </div>
                </div>

                <div class="agreement">
                    登录即代表您已同意<a href="#">《用户协议》</a>和<a href="#">《隐私政策》</a>
                </div>
            </div>
        </div>
    </div>

    <script>
        // 标签页切换
        document.querySelectorAll('.login-tab').forEach(tab => {
            tab.addEventListener('click', function() {
                // 移除所有标签页的active类
                document.querySelectorAll('.login-tab').forEach(t => {
                    t.classList.remove('active');
                });
                // 给当前点击的标签页添加active类
                this.classList.add('active');
                
                // 隐藏所有内容
                document.querySelectorAll('.tab-content').forEach(content => {
                    content.classList.remove('active');
                });
                // 显示对应的内容
                const tabId = this.getAttribute('data-tab') + '-tab';
                document.getElementById(tabId).classList.add('active');
            });
        });

        // 验证码倒计时
        const codeBtn = document.querySelector('.code-btn');
        codeBtn.addEventListener('click', function() {
            if (this.disabled) return;
            
            // 获取手机号
            const phoneInput = document.querySelector('#phone-tab .form-input');
            const phone = phoneInput.value.trim();
            
            // 简单验证手机号
            if (!/^1\d{10}$/.test(phone)) {
                alert('请输入正确的手机号');
                return;
            }
            
            // 开始倒计时
            let countdown = 60;
            this.disabled = true;
            this.textContent = `${countdown}秒后重新获取`;
            
            const timer = setInterval(() => {
                countdown--;
                this.textContent = `${countdown}秒后重新获取`;
                
                if (countdown <= 0) {
                    clearInterval(timer);
                    this.disabled = false;
                    this.textContent = '获取验证码';
                }
            }, 1000);
            
            // 这里可以添加发送验证码的逻辑
            console.log('发送验证码到手机号：' + phone);
        });

        // 登录按钮点击事件
        document.querySelectorAll('.login-btn').forEach(btn => {
            btn.addEventListener('click', function() {
                // 这里可以添加登录逻辑
                window.location.href = 'index.html';
            });
        });
    </script>
</body>
</html> 